﻿using System;
using System.Drawing;
using System.Collections.Generic;
namespace ApiBetaSeries
{
    /// <summary>
    /// Interface of Episode
    /// </summary>
    public interface IEpisode
    {
        /// <summary>
        /// Title of the show
        /// </summary>
        string Show { get; set; }
        /// <summary>
        /// Url of the show
        /// </summary>
        string UrlShow { get; set; }
        /// <summary>
        /// Season of the episode
        /// </summary>
        int Season { get; set; }

        /// <summary>
        /// Number of this episode
        /// </summary>
        int Number { get; set; }
        /// <summary>
        /// Number of this episode : SxxExx
        /// </summary>
        string NumberFormat { get; set; }
        /// <summary>
        /// Difusion date
        /// </summary>
        DateTime Date { get; set; }
        /// <summary>
        /// Title of this episode
        /// </summary>
        string Title { get; set; }
        /// <summary>
        /// Description of this episode
        /// </summary>
        string Description { get; set; }

        /// <summary>
        /// Url of the picture for this episode
        /// </summary>
        string Screen { get; set; }

        /// <summary>
        /// If the user has seen this episode
        /// </summary>
        bool HasSeen { get; set; }


        /// <summary>
        /// Picture for this episode
        /// </summary>
        Bitmap ScreenBitmap { get; }

        /// <summary>
        /// if the episode has been downloaded by the member
        /// </summary>
        bool Downloaded { get; set; }

        /// <summary>
        /// Subtitle of the episode
        /// </summary>
        List<ISubtitle> Subtitles { get; set; }

        /// <summary>
        /// Number of people who mark this episode
        /// </summary>
        int NbMark { get; set; }

        /// <summary>
        /// Average mark of this episode
        /// </summary>
        double AverageMark { get; set; }

        /// <summary>
        /// Mark the user give to this episode
        /// </summary>
        int Mark { get; set; }


        /* Methods */

        /// <summary>
        /// Mark the episode as watched on betaseries
        /// </summary>
        /// <param name="token">token of the member</param>
        /// <param name="note">note of the episode (default => none)</param>
        void SetWatched(string token, int note = -1);
        /// <summary>
        /// Mark the episode as watched for the member
        /// </summary>
        /// <param name="user">the member</param>
        /// <param name="note">note of the episode (default = note)</param>
        void SetWatched(IUser user, int note = -1);
        /// <summary>
        /// Mark the episode as downloaded
        /// </summary>
        /// <param name="token">token of the member</param>
        /// <returns>if the episode is download or not</returns>
        bool SetDownloaded(string token);
        /// <summary>
        /// Mark the episode as downloaded for the member
        /// </summary>
        /// <param name="user">the member</param>
        /// <returns>if the episode is download or not</returns>
        bool SetDownloaded(IUser user);

        /// <summary>
        /// Get all the subtitles for the episode
        /// </summary>
        /// <param name="type">VO/VF/VOVF</param>
        /// <returns>List of subtitles</returns>
        List<ISubtitle> GetSubtitles(SubtitleLanguage type = SubtitleLanguage.VOVF);

        /// <summary>
        /// Defined a mark for this episode
        /// </summary>
        /// <param name="user">the member who marks this episode</param>
        /// <param name="mark">mark of this episode</param>
        void SetMark(IUser user, int mark);

        /// <summary>
        /// Defined a mark for this episode
        /// </summary>
        /// <param name="user">token of an identified member</param>
        /// <param name="mark">mark of this episode</param>
        void SetMark(string token, int mark);

    }
}
